#ifndef CHESS_MOVE_H
#define CHESS_MOVE_H

#include <iostream>
#include "BoardPosition.h"
#include "Piece.h"

/**
 * This Move class simply holds all the information necessary in moving a piece (used for undo)
 */
class Move {
   public: //methods

      //! Constructor
      Move() {}

      //! Constructor
      Move(BoardPosition & begin, BoardPosition & last,
           Piece * movedPiece, Piece * takenPiece, Piece * changedPiece = NULL);

      ~Move() {}

      Move & operator=(Move & other);

      std::ostream & Save(std::ostream & os);

      //! Accessor methods
      BoardPosition GetStartPos() {
         return start;
      }
      BoardPosition GetEndPos() {
         return end;
      }

      Piece * GetMovedPiece() {
         return moved;
      }

      Piece* GetTakenPiece() {
         return taken;
      }

   private:
      //! Starting boardposition of the piece moved
      BoardPosition start;
      //! Ending boardposition
      BoardPosition end;
      Piece * moved;
      Piece * taken;
      Piece * changed;
};

#endif
